package de.wbh.gwt.form.layouter.shared.event;

import com.allen_sauer.gwt.dnd.client.PickupDragController;
import com.google.web.bindery.event.shared.Event;

public class DragControllerAddedEvent extends Event<DragControllerAddedEvent.Handler> {

	public static interface Handler {
		void onDragControllerAdded(DragControllerAddedEvent event);
	}

	private static final Type<Handler> TYPE = new Type<DragControllerAddedEvent.Handler>();

	public static Type<Handler> getType() {
		return TYPE;
	}

	private final PickupDragController dragController;

	public DragControllerAddedEvent(PickupDragController dragController) {
		this.dragController = dragController;
	}

	@Override
	protected void dispatch(Handler handler) {
		handler.onDragControllerAdded(this);
	}

	@Override
	public Event.Type<Handler> getAssociatedType() {
		return TYPE;
	}

	public PickupDragController getDragController() {
		return this.dragController;
	}

}
